package com.yuanzong.wuliu.controller.admin.auth;

import com.yuanzong.wuliu.common.vo.ApiResult;
import com.yuanzong.wuliu.controller.admin.auth.param.AdminAuthLoginParam;
import com.yuanzong.wuliu.service.admin.auth.AdminAuthService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "管理端 - 认证")
@RequestMapping("/admin/auth/auth")
@Slf4j
public class AdminAuthController {

    @Autowired
    private AdminAuthService adminAuthService;

    @ApiOperation("登录")
    @RequestMapping(value = "/login", method = {RequestMethod.POST})
    public ApiResult login(@RequestBody AdminAuthLoginParam param) throws Exception {
        ApiResult result = adminAuthService.login(param);
        return result;
    }
}
